
<h1><span class="yiyi-st" id="yiyi-12">numpy.floor_divide</span></h1>
        <blockquote>
        <p>原文：<a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.floor_divide.html">https://docs.scipy.org/doc/numpy/reference/generated/numpy.floor_divide.html</a></p>
        <p>译者：<a href="https://github.com/wizardforcel">飞龙</a> <a href="http://usyiyi.cn/">UsyiyiCN</a></p>
        <p>校对：（虚位以待）</p>
        </blockquote>
    
<dl class="data">
<dt id="numpy.floor_divide"><span class="yiyi-st" id="yiyi-13"> <code class="descclassname">numpy.</code><code class="descname">floor_divide</code><span class="sig-paren">(</span><em>x1</em>, <em>x2</em><span class="optional">[</span>, <em>out</em><span class="optional">]</span><span class="sig-paren">)</span><em class="property"> = &lt;ufunc &apos;floor_divide&apos;&gt;</em></span></dt>
<dd><p><span class="yiyi-st" id="yiyi-14">返回小于或等于输入的除法的最大整数。</span><span class="yiyi-st" id="yiyi-15">它等效于Python <code class="docutils literal"><span class="pre">//</span></code>运算符，并与Python <code class="docutils literal"><span class="pre">%</span></code>（<a class="reference internal" href="numpy.remainder.html#numpy.remainder" title="numpy.remainder"><code class="xref py py-obj docutils literal"><span class="pre">remainder</span></code></a>）函数配对，使<code class="docutils literal"><span class="pre">b </span> <span class="pre">=</span> <span class="pre">a</span> <span class="pre">％</span> <span class="pre">b</span> <span class="pre">+</span> <span class="pre">t14&gt; <span class="pre">*</span> <span class="pre">（a</span> <span class="pre">//</span> <span class="pre">b）</span></span></code></span></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name">
<col class="field-body">
<tbody valign="top">
<tr class="field-odd field"><th class="field-name"><span class="yiyi-st" id="yiyi-16">参数：</span></th><td class="field-body"><p class="first"><span class="yiyi-st" id="yiyi-17"><strong>x1</strong>：array_like</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-18">分子。</span></p>
</div></blockquote>
<p><span class="yiyi-st" id="yiyi-19"><strong>x2</strong>：array_like</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-20">分母。</span></p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name"><span class="yiyi-st" id="yiyi-21">返回：</span></th><td class="field-body"><p class="first"><span class="yiyi-st" id="yiyi-22"><strong>y</strong>：ndarray</span></p>
<blockquote class="last">
<div><p><span class="yiyi-st" id="yiyi-23">y = floor（<em class="xref py py-obj">x1</em> / <em class="xref py py-obj">x2</em>）</span></p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title"><span class="yiyi-st" id="yiyi-24">也可以看看</span></p>
<dl class="last docutils">
<dt><span class="yiyi-st" id="yiyi-25"><a class="reference internal" href="numpy.remainder.html#numpy.remainder" title="numpy.remainder"><code class="xref py py-obj docutils literal"><span class="pre">remainder</span></code></a></span></dt>
<dd><span class="yiyi-st" id="yiyi-26">剩余与floor_divide互补。</span></dd>
<dt><span class="yiyi-st" id="yiyi-27"><a class="reference internal" href="numpy.divide.html#numpy.divide" title="numpy.divide"><code class="xref py py-obj docutils literal"><span class="pre">divide</span></code></a></span></dt>
<dd><span class="yiyi-st" id="yiyi-28">标准部门。</span></dd>
<dt><span class="yiyi-st" id="yiyi-29"><a class="reference internal" href="numpy.floor.html#numpy.floor" title="numpy.floor"><code class="xref py py-obj docutils literal"><span class="pre">floor</span></code></a></span></dt>
<dd><span class="yiyi-st" id="yiyi-30">将数字向零舍入到最接近的整数。</span></dd>
<dt><span class="yiyi-st" id="yiyi-31"><a class="reference internal" href="numpy.ceil.html#numpy.ceil" title="numpy.ceil"><code class="xref py py-obj docutils literal"><span class="pre">ceil</span></code></a></span></dt>
<dd><span class="yiyi-st" id="yiyi-32">将数字向最接近的整数向无穷大舍入。</span></dd>
</dl>
</div>
<p class="rubric"><span class="yiyi-st" id="yiyi-33">例子</span></p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">floor_divide</span><span class="p">(</span><span class="mi">7</span><span class="p">,</span><span class="mi">3</span><span class="p">)</span>
<span class="go">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">floor_divide</span><span class="p">([</span><span class="mf">1.</span><span class="p">,</span> <span class="mf">2.</span><span class="p">,</span> <span class="mf">3.</span><span class="p">,</span> <span class="mf">4.</span><span class="p">],</span> <span class="mf">2.5</span><span class="p">)</span>
<span class="go">array([ 0.,  0.,  1.,  1.])</span>
</pre></div>
</div>
</dd></dl>
